Repository navigation
fix: cache static assets and load result rows only when needed - #20
Merged
Merged
Conversation
Hashed files under /_next/static/ get a one-year immutable cache instead of max-age=0. The homepage no longer downloads the default view's full summary after load just for its per-target rows: rows now live in /api/rows/<month>-<region>.json and load when the failure explorer nears the viewport or a results row is expanded, and other views fetch a summary without rows from /api/views/. Also bumps ws to 8.23.1 for GHSA-37g9-w4hg-h9qr.
✅ Deploy Preview for browser-benchmark ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ChloeQuijano
marked this pull request as ready for review
December 2, 2026 15:15
|
Tested at Ran locally. What I ran
Not covered
Security
|
Xrazik1
approved these changes
Dec 2, 2026
Xrazik1
left a comment
There was a problem hiding this comment.
No findings at a671cf4a; see the test report.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/_next/static/(scripts, CSS, fonts) were served withcache-control: max-age=0, must-revalidate, so every visit re-checked all of them. They now getpublic, max-age=31536000, immutable; a changed file always gets a new hashed URL.wsis bumped to 8.23.1 for GHSA-37g9-w4hg-h9qr (high severity), whichnpm auditnow fails on.Changes
netlify.toml: one[[headers]]rule for/_next/static/*.website/scripts/build-public-data.ts: writes each view without rows to/api/views/<month>-<region>.jsonand its rows to/api/rows/<month>-<region>.json. The old/api/summaries/files are no longer built, so a page loaded before this deploy gets a 404 and shows its load error instead of crashing on the new format.website/src/components/Dashboard.tsx: the default view uses only the data in the HTML; another view fetches its summary (about 22 KB compressed instead of 188 KB); rows are fetched after the first request and then for each view shown.Sections.tsx(FailureExplorer) requests rows when within 800 px of the viewport;ResultsTable.tsxrequests them when a row is expanded. Both show an error line if the rows fail to load.package-lock.json:ws8.22.2 → 8.23.1, within the rangespuppeteer-coreand the provider SDKs already allow.results.json,table.csv, and Copy page (it uses precomputed counts, not rows).Benchmark impact
CHANGELOG.mdVerification
npm run corpus:checknpm run lintnpm run typechecknpm test(518 passed)npm run website:buildAlso ran
npm audit --audit-level=high --omit=dev(clean), gitleaks and trufflehog (no findings), and checked the static export in a browser: staying at the top makes no/api/request; scrolling to the failure explorer fetches only the rows file and shows the same rows and counts; expanding a results row shows a loading line, then the detail rows; a?version=2026-09®ion=us-eastlink fetches only its 21 KB view file; no console errors. The cache header can be confirmed on this PR's deploy preview.🤖 Generated with Claude Code